package com.mrxuxu.common.core;

import com.mrxuxu.common.log.Log;
import com.mrxuxu.common.util.DateUtil;

import javax.servlet.*;
import java.io.IOException;
import java.util.Date;

/**
 * 项目初始话过滤
 * Created by belie on 2017/2/14.
 */
public class InitFilter implements Filter{

    private FilterConfig filterConfig;

    /**
     * 初始话行为
     * @param filterConfig
     * @throws ServletException
     */
    @Override
    public void init(FilterConfig filterConfig) throws ServletException {
        this.filterConfig=filterConfig;
        Log.logger.info("=========== acumulationManagement ========= init complet at "+ DateUtil.getStandardDate(new Date()));
    }

    /**
     * 过滤器真正执行的地方
     * @param request
     * @param response
     * @param chain
     * @throws IOException
     * @throws ServletException
     */
    @Override
    public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException {
        chain.doFilter(request,response);
        return;
    }

    /**
     * 销毁
     */
    @Override
    public void destroy() {

    }
}
